package cn.qyd.javathread;

/**
 * @author 邱运铎
 * @date 2024-03-14 12:09
 */
public class ThreadDemo01 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread1 = new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + "--线程开始执行---");
        });

        thread1.setName("线程1");
        thread1.start();
        Thread.sleep(2000);
        thread1.interrupt();
        Runnable runnable = new Runnable() {
            public void run() {
                System.out.println("ad");
            }
        };
        new Thread(runnable).start();
    }
}
